/*
 * @Author: ZhaoZhiqi
 * @Date: 2022-12-12 19:21:40
 * @LastEditors: ZhaoZhiqi
 * @LastEditTime: 2022-12-13 10:36:22
 * @Description: 用户管理
 * @FilePath: \tuanfeng-admin-front\src\api\user.ts
 */
import requset from "../utils/request"

/**
 * @description: 获取用户列表
 * @param {number} pageNo 默认1
 * @param {number} pageSize 默认10
 * @param {string} name 用户名称，模糊查询
 * @return {*}
 */
export const getUserListAPI = (data: any) => {
    return requset('user/getUserPageByParams', 'GET', data)
}

/**
 * @description: 新建用户
 * @param {string} name 名称
 * @param {number} rid 角色id
 * @param {string} remark 备注
 * @param {string} password 密码
 * @return {*}
 */
export const addUserAPI = (data: any) => {
    return requset('user/addUser', 'POST', data)
}

/**
 * @description: 更新用户
 * @param {number} id id
 * @param {number} rid 角色id
 * @param {string} name 名称
 * @param {string} remark 备注
 * @return {*}
 */
export const updateUserAPI = (data: any) => {
    return requset('user/updateUser', 'POST', data)
}

/**
 * @description: 删除用户
 * @param {number} id id
 * @return {*}
 */
export const deleteUserAPI = (data: any) => {
    return requset(`user/deleteUser/${data.id}`, 'GET', data)
}

/**
 * @description: 重置密码
 * @param {number} id id
 * @param {number} password 密码
 * @return {*}
 */
export const resetPasswordAPI = (data: any) => {
    return requset('user/resetPwd', 'POST', data)
}